package restaurant.selector.logic;

import java.util.List;
import java.util.Random;

import restaurant.selector.Restaurant;
import restaurant.selector.database.DatabaseManager;

public class SimpleLogic implements LogicInterface {

	private DatabaseManager dbManager;
	
	public SimpleLogic( DatabaseManager dbManager ){
	
		this.dbManager = dbManager;
	}
	
	@Override
	public String getRestaurant() {

		List<Restaurant> restaurants = dbManager.getRestaurants();
		Random rng = new Random();
		
		Restaurant randomRestaurant = restaurants.get(rng.nextInt(restaurants.size()));
		
		return randomRestaurant.getName();
	}
}
